package com.huohua.jobschduler.model.po;

import lombok.Getter;
import lombok.Setter;

import java.util.HashSet;
import java.util.Set;

@Getter
@Setter
public class JobNode {
    IJob job;
    Set<JobNode> preJobs;
    Boolean isRing = false;

    public JobNode(IJob job) {
        this.job = job;
        this.preJobs = new HashSet<>();
    }

    public void addPreJobNode(JobNode preJobNode) {
        if(preJobNode == null) {
            this.preJobs = new HashSet<>();
        }
        this.preJobs.add(preJobNode);
    }
}
